Conversation
c49b232 to
fe02e9f
Compare
|
I think we need to call it |
| type_: TypeNameExpr, | ||
| ) -> None: | ||
| op = _edgeql.Token.RANGBRACKET | ||
| object.__setattr__(self, "type_filter", type_filter) |
There was a problem hiding this comment.
This is an issue for another PR (or not bothering), but all these __setattr__s and explicit __init__s in a dataclass are dodgy; are they all just so that op doesn't show up in the dataclass string like it would if it was declared with a default
msullivan
left a comment
There was a problem hiding this comment.
Need to find a new name probably though
| def create_intersection( | ||
| lhs: _T_Lhs, | ||
| rhs: _T_Rhs, | ||
| ) -> type[BaseGelModelIntersection[_T_Lhs, _T_Rhs]]: |
There was a problem hiding this comment.
We should consider caching this, maybe?
Or at least, put in a note to consider caching it...
| return result | ||
|
|
||
|
|
||
| def create_intersection( |
There was a problem hiding this comment.
Some comments about what is being done here exactly would be useful
| elif expr_object_types is not None: | ||
| self.cached_return_type = return_type | ||
| self.cached_return_type_proxy = None | ||
| worklist = list(expr_object_types) |
There was a problem hiding this comment.
Maybe name this something different than worklist here, and make a copy to populate the initial worklist?
(Instead of needing to recreate the worklist conditionally after the DFS loop)
| @classmethod | ||
| def when_type( | ||
| cls: _T_SelfModel, /, other_model: _T_OtherModel | ||
| ) -> type[BaseGelModelIntersection[_T_SelfModel, _T_OtherModel]]: ... |
There was a problem hiding this comment.
Maybe we should declare it as returning type[_T_OtherModel]?
That's probably the most useful thing.
There was a problem hiding this comment.
The thing is that you still want to be able to select pointers from _T_SelfModel. For example:
default.Inh_A.when_type(default.Inh_B).select(a=True, b=True)Though to be fair the type checking here is still busted...
Given a schema:
Supports queries such as: